<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="__PUBLIC__/jq/jquery-3.0.0.min.js"></script>
</head>
<style>
  #KK{width:500px;height:300px;border:1px solid red;background:lightgreen;}
</style>
 
<body>
<div id="kk">
<form name="mobileForm" name="regForm" method="post" action="<{:U('Phone/edit')}>">
  <div id="pop_phone" class="popbox1">
    <div class="pop_con_div">
      <p class="p3 pb20">新手机号将会替换旧手机号，相关短信将会在变更成功后发送至新手机</p>
      <input type="text" class="phone" id="p" value="<{$phone}>">
      <dl><dt>新手机号：</dt><dd><input type="text" id="mobile" name="newphone" placeholder="请填写新手机号"><span id="mobile_T" class="error"></span>
      	<button id="a" style="height:25px;">获取手机验证码</button>
      </dd></dl>
      <dl><dt>手机验证码：</dt><dd><input type="text" class="txt2" name="yzm" placeholder="请填写手机验证码"><span id="waitTime" class="error"></span>
      </dd></dl>
    </div>
    <div class="btns">
     <input type="submit" value="确 定" id="submitBtn" class="btn_sure c2">
      <input type="reset" value="取 消">
    </div>
  </div>
  </form>
</div>

<script>

// function checkForm(){
    
//       var newphone=document.regForm.newphone.value;
//       if(newphone.length!=11){
//         mobile.innerHTML="手机号长度必须是11位";
//         return false;
//       }else{
//         mobile.innerHTML="";
//       }
//       return true;
//     }


$(function(){
      $('#a').click(function(){
        var phone=$('.phone').val();
        // alert(phone);
        $('#a').html('已获取');
        $.ajax({
          url:"<{:U('Phone/ajax')}>",
          type:'post',
          dataType:'json',
          data:'phone='+phone,
          success:function(data){
            console.log(data);
          }
        })
        return false;
      })
    })
</script>

</body></html>